$(function () {
    if (state <= 10000 ){
        $('#vip').html("V0")
    }else if (state >10000 && state <=20000){
        $('#vip').html("V1")
    }else if (state >20000 && state <=50000){
        $('#vip').html("V2")
    }else if (state >50000 && state <=100000){
        $('#vip').html("V3")
    }else {
        $('#vip').html("V4")
    }



    $('#deleteActive').click(function () {
        var orderId=$('#deleteId').val();
        $.ajax({
            url:ctx+"homeHigh/deleteMycommodityOrderById?id="+orderId,
            type:"post",
            dataType:"json",
            success : function (data) {
                if (data.msg == '删除成功'){
                    $('#deleteModal').modal('hide');
                    toastr.success("删除成功");
                    setTimeout(function () {
                        window.location.reload();
                    },500)
                }
                else {
                    toastr.error("操作失败")
                }
            }
        })
    })

    $('#getInActive').click(function () {
        var orderId=$('#getId').val();
        $.ajax({
            url:ctx+"homeHigh/getInMycommodityOrderById?id="+orderId,
            type:"post",
            dataType:"json",
            success : function (data) {
                if (data.msg == '收货成功'){
                    $('#getModal').modal('hide');
                    toastr.success("收货成功");
                    setTimeout(function () {
                        window.location.reload();
                    },500)
                }
                else {
                    toastr.error("操作失败")
                }
            }
        })
    })
    
})



//删除框赋值
function deleteOrder(id) {
    $('#deleteId').val(id)
}

//收货框赋值
function getOrder(id) {
    $('#getId').val(id)
}

function removeClassType($this) {
    $($this).attr("title",$this.innerText)
}